package com.kaishengit.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.kaishengit.entity.Employee;
import com.kaishengit.entity.Project;
import com.kaishengit.entity.Task;
import com.kaishengit.service.TaskService;
import com.kaishengit.util.web.ServletUtil;

public class AllTask extends HttpServlet {

	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html");
		
		HttpSession session = request.getSession();
		
		Employee employee = (Employee) session.getAttribute("employee");
		Project project = (Project) session.getAttribute("project");
		
		TaskService service = new TaskService();
		List<Task> list = service.findAllTaskByEidAndPid(employee.getId(),project.getId());
		
		request.setAttribute("list", list);
		ServletUtil.forward(request, response, "alltask");
		

	}


}
